package com.bee.web.config;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

import com.bee.web.security.AES;

/**
 * 项目参数配置
 *
 * @author liuzy
 * @date 2015年6月10日
 */
public class ProjectConfigurer extends PropertyPlaceholderConfigurer {

	@Override
	protected String convertProperty(String propertyName, String propertyValue) {
		if (propertyValue.length() % 32 == 0) {
			try {
				return AES.decrypt(propertyValue, propertyName);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return propertyValue;
	}

}
